﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using BusinessLogic;
using BusinessObject;
namespace WebTeamplate
{
    public partial class Login : BasePage
    {
       
        protected void Page_Load(object sender, EventArgs e)
        {
            //this.Page.Theme = "";
        }
        protected void Login1_LoggedIn(object sender, EventArgs e)
        {
            string returnUrl = Request.QueryString["ReturnUrl"];
            if (returnUrl==null || returnUrl == string.Empty)
            {
                MembershipUser user = Membership.GetUser(Login1.UserName);
                if (user != null)
                {
                    Vw_aspnet_Roles objRole = UserProfileUtil.GetMaxRole(new Guid(user.ProviderUserKey.ToString()), this.applicationName);
                    if (objRole != null)
                        Response.Redirect(objRole.DefaultUrl);
                    //else Response.Redirect("Default.aspx");
                }
            }

        }
    }
}
